package com.wql.rabbitmq.study;

import com.rabbitmq.client.Channel;
import com.wql.rabbitmq.ChannelFactory;
import com.wql.rabbitmq.Constant;

public class TopicTestForProducter {

	public static void main(String[] args) throws Exception {
		Channel channel = ChannelFactory.getChannel();
		channel.exchangeDeclare(Constant.TOPIC_NAME, "topic");
		for (String route : Constant.TOPIC_TOPIC) {
			String msg = route;
			System.out.println("send msg " + msg);
			channel.basicPublish(Constant.TOPIC_NAME, route, null, msg.getBytes());
		}
	}

}
